package cn.xawl.gulimall.ware.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author lh
 * @date 2020/08/11 20:21:00
 **/
@EnableTransactionManagement
@MapperScan(basePackages = "cn.xawl.gulimall.ware.dao")
public class WareMybatisConfig {

    /**
     * 引入分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        paginationInterceptor.setOverflow(true); //请求页面大于最大页面后的操作 true调回到首页，默认 false 继续请求
        paginationInterceptor.setLimit(1000); //单页最大限制
        return paginationInterceptor;
    }

}
